﻿using MediatR;
using System.WXT.Domain;
using System.WXT.Infrstructre.Interface;
using System.WXT.WebAPI.Application.Command.WorkerHourCommand;

namespace System.WXT.WebAPI.Application.CommandHandlers.WorkeHourCommandHandlers
{
    public class WorkeHourBackFillCommandHandlers:IRequestHandler<WorkerHourBackFillCommand,WorkerHour>
    {
        protected readonly IWorkerHourRepository workerHourRepository;

        public WorkeHourBackFillCommandHandlers(IWorkerHourRepository workerHourRepository)
        {
            this.workerHourRepository = workerHourRepository;
        }
        /// <summary>
        /// 工人工时反填
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        public async Task<WorkerHour> Handle(WorkerHourBackFillCommand request, CancellationToken cancellationToken)
        {
            var list = await workerHourRepository.GetBaby(request.workerHourId);
            return list;
        }
    }
}
